<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="__PUBLIC__/Admin/css/font.css">
    <link rel="stylesheet" href="__PUBLIC__/Admin/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__PUBLIC__/Admin/js/xadmin.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/lang/zh-cn/zh-cn.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
    <div class="x-body">
        <form class="layui-form" method="post">
          <div class="layui-form-item">
              <label for="L_title" class="layui-form-label">
                  <span class="x-red">*</span>文章标题
              </label>
              <div class="layui-input-inline hz-w-600">
                  <input type="text" id="L_title" name="title" value="{$data.title}" class="layui-input" required lay-verify="required">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_cat_name" class="layui-form-label">
                  <span class="x-red"></span>所属分类
              </label>
              <div class="layui-input-inline">
                <select name="cat_id">
                  <option value="">请选择...</option>
                  <volist name="parentData" id="vo"><option value="{$vo.id}" <if condition="$vo['id'] eq $data['cat_id']">selected</if> ><?php echo str_repeat('-', 8*$vo['level']).$vo['cat_name'];?></option></volist>    
                </select>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_site_id" class="layui-form-label">
                  <span class="x-red"></span>所属站点
              </label>
              <div class="layui-input-inline">
                  <select name="site_id" lay-verify="required">
                    <option value="">请选择站点</option>
                    <volist name="site" id="vo"><option value="{$vo.id}" <if condition="$vo['id'] eq $data['site_id']">selected</if>>{$vo.site_name}</option></volist>
                  </select>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_keywords" class="layui-form-label">
                  <span class="x-red"></span>关键字
              </label>
              <div class="layui-input-inline hz-w-600">
                  <input type="text" id="L_keywords" name="keywords" value="{$data.keywords}" autocomplete="off" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  <span class="x-red">*</span>请用英文,分隔（关键字,描述）
              </div>
          </div>
          <div class="layui-form-item layui-form-text">
              <label for="description" class="layui-form-label">
                  描述
              </label>
              <div class="layui-input-block hz-w-600">
                  <textarea placeholder="请输入内容" id="description" name="description" class="layui-textarea">{$data.description}</textarea>
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label"><span class="x-red"></span>推荐</label>
              <div class="layui-input-block">
                <input type="radio" name="is_hot" <if condition="$data['is_hot'] eq 1">checked</if> lay-skin="primary" value="1" title="是">
                <input type="radio" name="is_hot" <if condition="$data['is_hot'] eq 0">checked</if> lay-skin="primary" value="0" title="否" >
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_author" class="layui-form-label">
                  <span class="x-red"></span>作者
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_author" name="author" value="{$data.author}" lay-verify="author"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_click_count" class="layui-form-label">
                  <span class="x-red"></span>点击量
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_click_count" name="click_count" value="{$data.click_count}" lay-verify="click_count"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item layui-form-text">
              <label for="description" class="layui-form-label">
                  文章内容
              </label>
              <div class="layui-input-block">
                  <textarea id="content" name="content" class="layui-textarea">{$data.content}</textarea>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <input type="hidden" name="id" value="{$data.id}">
              <button  class="layui-btn" lay-filter="add" lay-submit="">
                  确定
              </button>
          </div>
      </form>
    </div>
    <script>
      layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form()
        ,layer = layui.layer;
      
        //自定义验证规则
        form.verify({
          nikename: function(value){
            if(value.length < 5){
              return '昵称至少得5个字符啊';
            }
          }
          ,pass: [/(.+){6,12}$/, '密码必须6到12位']
          ,repass: function(value){
              if($('#L_pass').val()!=$('#L_repass').val()){
                  return '两次密码不一致';
              }
          }
        });

      });

      UE.getEditor('content', {
        "initialFrameWidth" : "100%",   // 宽
        "initialFrameHeight" : 400,      // 高
        "maximumWords" : 10000            // 最大可以输入的字符数量
      });
  </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();</script>
  </body>

</html>